// pages/school/school.js
const API = require('../../http/API')
const http = require('../../http/http')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    subMenuList: [
      {
        id: 0,
        text: "全部课程",
        image: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h1-b_2211.png"
      },
      {
        id: 1,
        text: "直播课",
        image: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h2-o_2211.png"
      },
      {
        id: 2,
        text: "特训班",
        image: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h3-p_2211.png"
      },
      {
        id: 3,
        text: "入门班",
        image: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h4-g_2211.png"
      },
      {
        id: 4,
        text: "学习问答",
        image: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h5-p_2211.png"
      },
      {
        id: 5,
        text: "学员作业",
        image: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h6-r_2211.png"
      },
      {
        id: 6,
        text: "怎样学习",
        image: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h7-y_2211.png"
      },
      {
        id: 7,
        text: "关于我们",
        image: "https://assets-cdn.lanqb.com/imgv3_m/images-icon/submenu/h8-c_2211.png"
      }
    ],
    // 轮播图
    bannerPic: [],
    // 热门推荐
    hot: [
      { id: 0, text: "坚持画画，领高额奖学金" },
      { id: 1, text: "30天学会用ipad画插画" },
      { id: 2, text: "日系插画，怎么上手" },
      { id: 3, text: "重磅！日系插画直播教学" },
    ],
    // 热门课程推荐
    hotClassList: [],
    // 主讲
    zhujiangList: [
      { id: 0, src: "https://ss.lanqb.com/20170412/1491999115SAsYuEnx-c-924x924.JPG?imageView2/1/w/190/h/190", name: "DAdonika", year: "行业经验：6年" },
      { id: 1, src: "https://ss.lanqb.com/20171219/1513669790wHxcZkCE-c-511x511.jpg?imageView2/1/w/190/h/190", name: "黑沢芥子", year: "行业经验：7年" },
      { id: 2, src: "https://ss.lanqb.com/38e6b64b-0e7a-4ec6-b919-df5d8aeb61d4.jpg?imageView2/1/w/190/h/190", name: "CPKon", year: "行业经验：7年" },
    ],
    // 学员作品列表
    worksList: [],
    historyList: [
      { id: 0, year: 2011, text: [{ con: "成立初期" }, { con: "蓝铅笔社区论坛上线运营" }] },
      { id: 1, year: 2014, text: [{ con: "迅速成长" }, { con: "蓝铅笔社区网校完成天使轮风险投资" }, { con: "蓝铅笔网校兴趣插画类学习项目启动" }] },
      { id: 2, year: 2016, text: [{ con: "持续攀升" }, { con: "蓝铅笔学员任治和荣获北美动画师擂台赛冠军" }, { con: "蓝铅笔获得中文在线文化产业基金、华睿资本 投资的千万人民币A轮融资" }] },
      { id: 3, year: 2018, text: [{ con: "创新发展" }, { con: "蓝铅笔荣获国家级“高新技术企业”评定" }, { con: "蓝铅笔向国家版权局申获7项软件著作权" }] },
      { id: 4, year: 2020, text: [{ con: "口碑信任" }, { con: "蓝铅笔荣获“新浪中国”2020年度影响力艺术教育品牌" }, { con: "蓝铅笔荣获“回响中国”2020年度口碑影响力职业教育品牌" }] },
      { id: 5, year: 2021, text: [{ con: "口碑信任" }, { con: "蓝铅笔参与第七届中国品牌创新发展论坛并入选“中国品牌创新发展工程" }, { con: "蓝铅笔创始人参与央视《大国匠心》、《企业家精神》节目录制" }] }
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getBannerPic()
    this.getHotClass()
    this.getworksList()
  },
  // 获取轮播图
  getBannerPic() {
    http(API.banner,{
      type:"m",
      local_code:20,
      limit:6,
      order:"weight",
    }).then(res => {
      this.setData({ bannerPic: res.data.data })
    })
  },
  // 获取热门课程推荐
  getHotClass() {
    http(API.hotclass).then(res => {
      this.setData({ hotClassList: res.data.data })
    })
  },
  // 获取学生作品
  getworksList() {
    http(API.works,{
      sort:"-top_weight",
      limit:6,
    }).then(res => {
      this.setData({ worksList: res.data.data })
    })
  }
})